package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_retur_shop_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionReturShopDetail.findAll", query = "SELECT t FROM PosTransactionReturShopDetail t"),
//    @NamedQuery(name = "PosTransactionReturShopDetail.findBySync", query = "SELECT t FROM PosTransactionReturShopDetail t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosTransactionReturShopDetail.findByReturShopDetailId", query = "SELECT t FROM PosTransactionReturShopDetail t WHERE t.returShopDetailId = :returShopDetailId"),
//    @NamedQuery(name = "PosTransactionReturShopDetail.findByReturShopDetailQuantity", query = "SELECT t FROM PosTransactionReturShopDetail t WHERE t.returShopDetailQuantity = :returShopDetailQuantity"),
//    @NamedQuery(name = "PosTransactionReturShopDetail.findByReturShopDetailEstimatedDate", query = "SELECT t FROM PosTransactionReturShopDetail t WHERE t.returShopDetailEstimatedDate = :returShopDetailEstimatedDate")})
public class PosTransactionReturShopDetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "retur_shop_detail_id")
    private Integer returShopDetailId;
    @Basic(optional = false)
    @Column(name = "retur_shop_detail_quantity")
    private Integer returShopDetailQuantity;
    @Basic(optional = false)
    @Column(name = "retur_shop_detail_estimated_date")
    @Temporal(TemporalType.DATE)
    private Date returShopDetailEstimatedDate;
    @Lob
    @Column(name = "retur_shop_detail_description")
    private String returShopDetailDescription;
    @Column(name = "retur_shop_detail_size")
    private String returShopDetailSize;
    @JoinColumn(name = "retur_shop_detail_retur_shop_id", referencedColumnName = "retur_shop_id")
    @ManyToOne(optional = false)
    private PosTransactionReturShop returShopDetailReturShopId;
    @JoinColumn(name = "retur_shop_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem returShopDetailItemId;
    @JoinColumn(name = "retur_shop_detail_status_id", referencedColumnName = "status_id")
    @ManyToOne(optional = false)
    private PosMasterStatus returShopDetailStatusId;
    @JoinColumn(name = "retur_shop_detail_size_id", referencedColumnName = "size_id")
    @ManyToOne(optional = false)
    private PosMasterSize returShopDetailSizeId;

    public PosTransactionReturShopDetail() {
    }

    public PosTransactionReturShopDetail(Integer returShopDetailId) {
        this.returShopDetailId = returShopDetailId;
    }

    public PosTransactionReturShopDetail(Integer returShopDetailId, Integer returShopDetailQuantity, Date returShopDetailEstimatedDate, String returShopDetailDescription) {
        this.returShopDetailId = returShopDetailId;
        this.returShopDetailQuantity = returShopDetailQuantity;
        this.returShopDetailEstimatedDate = returShopDetailEstimatedDate;
        this.returShopDetailDescription = returShopDetailDescription;
    }

    public String getReturShopDetailDescription() {
        return returShopDetailDescription;
    }

    public void setReturShopDetailDescription(String returShopDetailDescription) {
        this.returShopDetailDescription = returShopDetailDescription;
    }

    public Date getReturShopDetailEstimatedDate() {
        return returShopDetailEstimatedDate;
    }

    public void setReturShopDetailEstimatedDate(Date returShopDetailEstimatedDate) {
        this.returShopDetailEstimatedDate = returShopDetailEstimatedDate;
    }

    public String getReturShopDetailSize() {
        return returShopDetailSize;
    }

    public void setReturShopDetailSize(String returShopDetailSize) {
        this.returShopDetailSize = returShopDetailSize;
    }

    public PosMasterSize getReturShopDetailSizeId() {
        return returShopDetailSizeId;
    }

    public void setReturShopDetailSizeId(PosMasterSize returShopDetailSizeId) {
        this.returShopDetailSizeId = returShopDetailSizeId;
    }

    public Integer getReturShopDetailId() {
        return returShopDetailId;
    }

    public void setReturShopDetailId(Integer returShopDetailId) {
        this.returShopDetailId = returShopDetailId;
    }

    public PosMasterItem getReturShopDetailItemId() {
        return returShopDetailItemId;
    }

    public void setReturShopDetailItemId(PosMasterItem returShopDetailItemId) {
        this.returShopDetailItemId = returShopDetailItemId;
    }

    public Integer getReturShopDetailQuantity() {
        return returShopDetailQuantity;
    }

    public void setReturShopDetailQuantity(Integer returShopDetailQuantity) {
        this.returShopDetailQuantity = returShopDetailQuantity;
    }

    public PosTransactionReturShop getReturShopDetailReturShopId() {
        return returShopDetailReturShopId;
    }

    public void setReturShopDetailReturShopId(PosTransactionReturShop returShopDetailReturShopId) {
        this.returShopDetailReturShopId = returShopDetailReturShopId;
    }

    public PosMasterStatus getReturShopDetailStatusId() {
        return returShopDetailStatusId;
    }

    public void setReturShopDetailStatusId(PosMasterStatus returShopDetailStatusId) {
        this.returShopDetailStatusId = returShopDetailStatusId;
    }
    
    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (returShopDetailId != null ? returShopDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionReturShopDetail)) {
            return false;
        }
        PosTransactionReturShopDetail other = (PosTransactionReturShopDetail) object;
        if ((this.returShopDetailId == null && other.returShopDetailId != null) || (this.returShopDetailId != null && !this.returShopDetailId.equals(other.returShopDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionReturShopDetail[ returShopDetailId=" + returShopDetailId + " ]";
    }
}
